var express = require('express');
var router = express.Router();
const conn = require('../conn');
conn.authenticate().then(() => {
    console.log('链接成功.');
}).catch(err => {
    console.error('链接失败.', err);
});
const wordData = conn.define('words', {}, {
    timestamps: false,
    freezeTableName: true
});
/* GET users listing. */
router.get('/', function (req, res, next) {
    res.send('这是我的node站点测试');
});
// 新增单词内容
router.post('/add', function (req, res) {
    if (req.body) {
        wordData.create({
            word: req.body.word
        });
    }
});

module.exports = router;
